
from rest_framework.generics import ListAPIView
from rest_framework.viewsets import ModelViewSet
from django.contrib.auth.models import Permission,ContentType
from meiduo_admin.serializers.perm_serializers import *
from meiduo_admin.custom_paginations import MyPage



class PermViewSet(ModelViewSet):
    queryset = Permission.objects.all()
    serializer_class = PermModelSerializer
    pagination_class = MyPage


    def get_queryset(self):
        return self.queryset.order_by('id')



class PermContentTypeView(ListAPIView):
    queryset = ContentType.objects.all()
    serializer_class = PermContentTypeModelSerializer

